package me.zhengjie.modules.common.service;

import me.zhengjie.modules.common.domain.TEngineerMoney;
import me.zhengjie.modules.common.service.dto.TEngineerMoneyDTO;
import me.zhengjie.modules.common.service.dto.TEngineerMoneyQueryCriteria;
import me.zhengjie.modules.customer.domain.TCustomerContract;
import me.zhengjie.modules.serviceprovider.domain.TServiceproviderContract;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * @author lhd
 * @date 2021-04-25
 */
@CacheConfig(cacheNames = "tEngineerMoney")
public interface TEngineerMoneyService {

    /**
     * queryAll 分页
     * @param criteria
     * @param pageable
     * @return
     */
    // @Cacheable(keyGenerator = "keyGenerator")
    Object queryAll(TEngineerMoneyQueryCriteria criteria, Pageable pageable);

    /**
     * queryAll 不分页
     * @param criteria
     * @return
     */
    // @Cacheable(keyGenerator = "keyGenerator")
    public Object queryAll(TEngineerMoneyQueryCriteria criteria);

    /**
     * findById
     * @param id
     * @return
     */
    // @Cacheable(key = "#p0")
    TEngineerMoneyDTO findById(Long id);

    /**
     * create
     * @param resources
     * @return
     */
    // @CacheEvict(allEntries = true)
    List<TEngineerMoneyDTO> create(List<TEngineerMoney> resources);

    /**
     * update
     * @param resources
     */
    // @CacheEvict(allEntries = true)
    void update(List<TEngineerMoney> resources);

    /**
     * delete
     * @param resources
     */
    // @CacheEvict(allEntries = true)
    void delete(List<TEngineerMoney> resources);

    /**
     * 获取工程师对应的费用信息
     * @param contract
     * @param major
     * @param level
     * @return
     */
    Long getEngineerConst(TCustomerContract contract, String major, String level);
    Long getEngineerConst(TServiceproviderContract contract, String major, String level);
}
